﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using bdxyit.com.RecruitmentAppSys.IDAL;
using bdxyit.com.RecruitmentAppSys.DALFactory;
using bdxyit.com.RecruitmentAppSys.Models;
using bdxyit.com.RecruitmentAppSys.ViewModels;

namespace bdxyit.com.RecruitmentAppSys.BLL
{
    public class UserInfoBLL
    {
        private static readonly IUserInfoDAL UserInfoDal = DataAccess.CreateUserInfo();
        /// <summary>
        /// 创建用户基本信息
        /// </summary>
        /// <param name="ui"></param>
        /// <returns></returns>
        public static bool CreateBasicInfo(UserInfo ui)
        {
            bool flag = false;
            flag = UserInfoDal.InsertUserInfo(ui);
            return flag;
        }

        /// <summary>
        /// 删除一个用户基本信息
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public static bool RemoveBasicInfo(string userID)
        {
            bool flag = false;
            flag = UserInfoDal.DeleteUserInfoByUserId(userID);
            return flag;
        }

        /// <summary>
        ///获取一个用户
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public static UserInfo GetBasicInfoByUserID(string userID)
        {
            UserInfo ui = UserInfoDal.SelectUserInfoByUserId(userID);
            return ui;
        }

        /// <summary>
        ///获取一个用户
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public static bool EditBasicInfo(UserInfo ui)
        {
            bool flag = UserInfoDal.UpdateUserInfo(ui);
            return flag;
        }
    }
}
